package model;

public class MotPondere implements Comparable<MotPondere>{
	private String mot;
	private double poids;
	
	public MotPondere() {}
	
	/*
	 * Poids init a 1
	 * */
	public MotPondere(String mot) {
		this.mot = mot;
		this.poids = 1;
	}
	
	public MotPondere(String mot, double poids) {
		this.mot = mot;
		this.poids = poids;
	}

	public String getMot() {
		return mot;
	}

	public void setMot(String mot) {
		this.mot = mot;
	}

	public double getPoids() {
		return poids;
	}

	public void setPoids(double poids) {
		this.poids = poids;
	}
	
	@Override
	public String toString(){
		return "("+this.mot+","+poids+")";
	}	

	public boolean equals (MotPondere o) {
		return (getMot().equals(o.getMot()));
		
	}
	
	@Override
	public int compareTo(MotPondere o) {
		// TODO Auto-generated method stub
		int ret = -1;
		if(this.getMot().equals(o.getMot())) ret = 0;
		return ret;
	}
	
	
}
